<?php

/**
 * BbSeason form base class.
 *
 * @method BbSeason getObject() Returns the current form's model object
 *
 * @package    vogue
 * @subpackage form
 * @author     Your name here
 * @version    SVN: $Id: sfDoctrineFormGeneratedTemplate.php 29553 2010-05-20 14:33:00Z Kris.Wallsmith $
 */
abstract class BaseBbSeasonForm extends BaseFormDoctrine
{
  public function setup()
  {
    $this->setWidgets(array(
      's_id'         => new sfWidgetFormInputHidden(),
      's_name'       => new sfWidgetFormInputText(),
      's_logo'       => new sfWidgetFormInputText(),
      's_descr'      => new sfWidgetFormTextarea(),
      's_rounds'     => new sfWidgetFormInputText(),
      'l_id'         => new sfWidgetFormDoctrineChoice(array('model' => $this->getRelatedModelName('BbLeague'), 'add_empty' => false)),
      'published'    => new sfWidgetFormInputText(),
      's_win_point'  => new sfWidgetFormInputText(),
      's_lost_point' => new sfWidgetFormInputText(),
      's_enbl_extra' => new sfWidgetFormInputText(),
      's_extra_win'  => new sfWidgetFormInputText(),
      's_extra_lost' => new sfWidgetFormInputText(),
      's_draw_point' => new sfWidgetFormInputText(),
      's_groups'     => new sfWidgetFormInputText(),
      's_win_away'   => new sfWidgetFormInputText(),
      's_draw_away'  => new sfWidgetFormInputText(),
      's_lost_away'  => new sfWidgetFormInputText(),
    ));

    $this->setValidators(array(
      's_id'         => new sfValidatorChoice(array('choices' => array($this->getObject()->get('s_id')), 'empty_value' => $this->getObject()->get('s_id'), 'required' => false)),
      's_name'       => new sfValidatorString(array('max_length' => 255, 'required' => false)),
      's_logo'       => new sfValidatorString(array('max_length' => 255, 'required' => false)),
      's_descr'      => new sfValidatorString(),
      's_rounds'     => new sfValidatorInteger(array('required' => false)),
      'l_id'         => new sfValidatorDoctrineChoice(array('model' => $this->getRelatedModelName('BbLeague'), 'required' => false)),
      'published'    => new sfValidatorString(array('max_length' => 1, 'required' => false)),
      's_win_point'  => new sfValidatorNumber(array('required' => false)),
      's_lost_point' => new sfValidatorNumber(array('required' => false)),
      's_enbl_extra' => new sfValidatorInteger(array('required' => false)),
      's_extra_win'  => new sfValidatorNumber(array('required' => false)),
      's_extra_lost' => new sfValidatorNumber(array('required' => false)),
      's_draw_point' => new sfValidatorNumber(array('required' => false)),
      's_groups'     => new sfValidatorInteger(array('required' => false)),
      's_win_away'   => new sfValidatorNumber(array('required' => false)),
      's_draw_away'  => new sfValidatorNumber(array('required' => false)),
      's_lost_away'  => new sfValidatorNumber(array('required' => false)),
    ));

    $this->widgetSchema->setNameFormat('bb_season[%s]');

    $this->errorSchema = new sfValidatorErrorSchema($this->validatorSchema);

    $this->setupInheritance();

    parent::setup();
  }

  public function getModelName()
  {
    return 'BbSeason';
  }

}
